import * as echarts from 'echarts'
// 首页对比折线图
const allData = {
    legend: {
        left: '45%',
        right: 0,
        top: 10,
        bottom: 0
    },
    grid: {
        top: '17%',
        left: '2%',
        right: '2%',
        bottom: '10%'
    },
    xAxis: {
        type: 'category',
        data: ["星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期天"],
    },
    yAxis: {},
    series: [
        {
            name: "实际销售额",
            type: "line",
            smooth: true,
            data: [],
            itemStyle: {
                color: '#FF005A',
                lineStyle: {
                    normal: {
                        color: '#FF005A'
                    }
                }
            }
        },
        {
            name: "预计销售额",
            type: "line",
            smooth: true,
            data: [],
            itemStyle: {
                color: '#3888FA',
                lineStyle: {
                    normal: {
                        color: '#3888FA'
                    }
                }
            },
            areaStyle: {
                color: '#F5F8FD'
            }
        }
    ]
}

// 首页销量对比图
const bastSalesVolume = {
  title: {
      text: '商品销量前五对比图',
      left: 20,
      top: 20
  },
  color: ['#2EC7C9', '#B6A2DE', '#5AB1EF', '#FFB980', '#D87A80'],
  toolbox: {
    show: true,
    feature: {
      mark: { show: true }
    }
  },
  series: [
    {
      name: 'Nightingale Chart',
      type: 'pie',
      radius: [0, 110],
      center: ['50%', '55%'],
      roseType: 'area',
      roseType: 'radius',
      itemStyle: {
        borderRadius: 3
      },
      itemStyle: {
        borderRadius: 8
      },
      label: {
      },
      data: [
        { value: 40, name: '玩具', label: {color: '#2EC7C9'} },
        { value: 38, name: '猪肉', label: {color: '#B6A2DE'} },
        { value: 32, name: '电饭煲', label: {color: '#5AB1EF'} },
        { value: 30, name: '体育用品', label: {color: '#FFB980'} },
        { value: 28, name: '家居用品', label: {color: '#D87A80'} }
      ],
      emphasis: {
        itemStyle: {
          shadowBlur: 10,
          shadowOffsetX: 0,
          shadowColor: 'rgba(0, 0, 0, 0.5)'
        }
      }
    }
  ]
}

// 进货量-销售量 对比图
const consumer = {
  title: {
    text: '周进-销对比图',
    textStyle: {
      fontSize: 14
    }
  },
  xAxis: {
      type: 'category',
      data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
  },
  grid: {
      top: '17%',
      left: '7%',
      right: '2%',
      bottom: '10%'
  },
  tooltip: {
    trigger: 'axis',
    axisPointer: {
      type: 'shadow'
    }
  },
  xAxis: {
    data: ['玩具', '猪肉', '家电', '体育', '食品']
  },
  yAxis: {
      type: 'value'
  },
  legend: {},
  series: [
      {
          data: [120, 200, 150, 80, 70],
          name: '进货量',
          type: 'bar',
          showBackground: true,
          backgroundStyle: {
              color: 'rgba(180, 180, 180, 0.2)'
          },
          itemStyle: {
            color: '#2EC7C9'
          }
      },
      {
          data: [130, 210, 140, 70, 60],
          name: '销售量',
          type: 'bar',
          showBackground: true,
          backgroundStyle: {
              color: 'rgba(180, 180, 180, 0.2)'
          },
          itemStyle: {
            color: '#5AB1EF'
          }
      }
  ]
}

export {
    allData,
    bastSalesVolume,
    consumer
}